import request from '@/utils/request'

export function getTrainInfoList() {
  return request({
    url: '/train/getInfoList',
    method: 'get'
  })
}

export function getTrainDeviceBinded() {
    return request({
      url: '/train/getTrainDeviceBinded',
      method: 'get'
    })
  }

export function getTrainPageInfos(data) {
  return request({
    url: '/train/getPageInfos',
    method: 'GET',
    params: data
  })
}

export function addOrUpdateBind(data) {
  return request({
    url: '/train/addOrUpdateBind',
    method: 'POST',
    data: data
  })
}

export function deleteDevice(trainId) {
  return request({
    url: '/train/deleteTrain',
    method: 'DELETE',
    params: { trainId: trainId }
  })
}

export function createOrUpdate(data) {
  return request({
    url: '/train/addOrUpdateTrain',
    method: 'POST',
    data: data
  })
}
